<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Runner::OptionParser</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Runner::OptionParser</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/runner/option_parser_rb.html">
                vendor/plugins/rspec/lib/spec/runner/option_parser.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                ::OptionParser
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000601">invoke_requires</a>&nbsp;&nbsp;
      <a href="#M000599">new</a>&nbsp;&nbsp;
      <a href="#M000600">order!</a>&nbsp;&nbsp;
      <a href="#M000598">parse</a>&nbsp;&nbsp;
      <a href="#M000605">parse_drb</a>&nbsp;&nbsp;
      <a href="#M000603">parse_generate_options</a>&nbsp;&nbsp;
      <a href="#M000607">parse_help</a>&nbsp;&nbsp;
      <a href="#M000602">parse_options_file</a>&nbsp;&nbsp;
      <a href="#M000606">parse_version</a>&nbsp;&nbsp;
      <a href="#M000608">stdout?</a>&nbsp;&nbsp;
      <a href="#M000604">write_generated_options</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">OPTIONS</td>
          <td>=</td>
          <td class="context-item-value">{         :pattern =&gt; [&quot;-p&quot;, &quot;--pattern [PATTERN]&quot;,&quot;Limit files loaded to those matching this pattern. Defaults to '**/*_spec.rb'&quot;,                                                  &quot;Separate multiple patterns with commas.&quot;,                                                  &quot;Applies only to directories named on the command line (files&quot;,                                                  &quot;named explicitly on the command line will be loaded regardless).&quot;],         :diff =&gt;    [&quot;-D&quot;, &quot;--diff [FORMAT]&quot;,&quot;Show diff of objects that are expected to be equal when they are not&quot;,                                              &quot;Builtin formats: unified|u|context|c&quot;,                                              &quot;You can also specify a custom differ class&quot;,                                              &quot;(in which case you should also specify --require)&quot;],         :colour =&gt;  [&quot;-c&quot;, &quot;--colour&quot;, &quot;--color&quot;, &quot;Show coloured (red/green) output&quot;],         :example =&gt; [&quot;-e&quot;, &quot;--example [NAME|FILE_NAME]&quot;,  &quot;Execute example(s) with matching name(s). If the argument is&quot;,                                                           &quot;the path to an existing file (typically generated by a previous&quot;,                                                           &quot;run using --format failing_examples:file.txt), then the examples&quot;,                                                           &quot;on each line of thatfile will be executed. If the file is empty,&quot;,                                                           &quot;all examples will be run (as if --example was not specified).&quot;,                                                           &quot; &quot;,                                                           &quot;If the argument is not an existing file, then it is treated as&quot;,                                                           &quot;an example name directly, causing RSpec to run just the example&quot;,                                                           &quot;matching that name&quot;],         :specification =&gt; [&quot;-s&quot;, &quot;--specification [NAME]&quot;, &quot;DEPRECATED - use -e instead&quot;, &quot;(This will be removed when autotest works with -e)&quot;],         :line =&gt; [&quot;-l&quot;, &quot;--line LINE_NUMBER&quot;, Integer, &quot;Execute behaviout or specification at given line.&quot;,                                                        &quot;(does not work for dynamically generated specs)&quot;],         :format =&gt; [&quot;-f&quot;, &quot;--format FORMAT[:WHERE]&quot;,&quot;Specifies what format to use for output. Specify WHERE to tell&quot;,                                                     &quot;the formatter where to write the output. All built-in formats&quot;,                                                     &quot;expect WHERE to be a file name, and will write to $stdout if it's&quot;,                                                     &quot;not specified. The --format option may be specified several times&quot;,                                                     &quot;if you want several outputs&quot;,                                                     &quot; &quot;,                                                     &quot;Builtin formats for examples: &quot;,                                                     &quot;progress|p               : Text progress&quot;,                                                     &quot;profile|o                : Text progress with profiling of 10 slowest examples&quot;,                                                     &quot;specdoc|s                : Example doc as text&quot;,                                                     &quot;indented|i               : Example doc as indented text&quot;,                                                     &quot;html|h                   : A nice HTML report&quot;,                                                     &quot;failing_examples|e       : Write all failing examples - input for --example&quot;,                                                     &quot;failing_example_groups|g : Write all failing example groups - input for --example&quot;,                                                     &quot; &quot;,                                                     &quot;Builtin formats for stories: &quot;,                                                     &quot;plain|p              : Plain Text&quot;,                                                     &quot;html|h               : A nice HTML report&quot;,                                                     &quot;progress|r           : Text progress&quot;,                                                     &quot; &quot;,                                                     &quot;FORMAT can also be the name of a custom formatter class&quot;,                                                     &quot;(in which case you should also specify --require to load it)&quot;],         :require =&gt; [&quot;-r&quot;, &quot;--require FILE&quot;, &quot;Require FILE before running specs&quot;,                                              &quot;Useful for loading custom formatters or other extensions.&quot;,                                              &quot;If this option is used it must come before the others&quot;],         :backtrace =&gt; [&quot;-b&quot;, &quot;--backtrace&quot;, &quot;Output full backtrace&quot;],         :loadby =&gt; [&quot;-L&quot;, &quot;--loadby STRATEGY&quot;, &quot;Specify the strategy by which spec files should be loaded.&quot;,                                                &quot;STRATEGY can currently only be 'mtime' (File modification time)&quot;,                                                &quot;By default, spec files are loaded in alphabetical order if --loadby&quot;,                                                &quot;is not specified.&quot;],         :reverse =&gt; [&quot;-R&quot;, &quot;--reverse&quot;, &quot;Run examples in reverse order&quot;],         :timeout =&gt; [&quot;-t&quot;, &quot;--timeout FLOAT&quot;, &quot;Interrupt and fail each example that doesn't complete in the&quot;,                                               &quot;specified time&quot;],         :heckle =&gt; [&quot;-H&quot;, &quot;--heckle CODE&quot;, &quot;If all examples pass, this will mutate the classes and methods&quot;,                                            &quot;identified by CODE little by little and run all the examples again&quot;,                                            &quot;for each mutation. The intent is that for each mutation, at least&quot;,                                            &quot;one example *should* fail, and RSpec will tell you if this is not the&quot;,                                            &quot;case. CODE should be either Some::Module, Some::Class or&quot;,                                            &quot;Some::Fabulous#method}&quot;],         :dry_run =&gt; [&quot;-d&quot;, &quot;--dry-run&quot;, &quot;Invokes formatters without executing the examples.&quot;],         :options_file =&gt; [&quot;-O&quot;, &quot;--options PATH&quot;, &quot;Read options from a file&quot;],         :generate_options =&gt; [&quot;-G&quot;, &quot;--generate-options PATH&quot;, &quot;Generate an options file for --options&quot;],         :runner =&gt; [&quot;-U&quot;, &quot;--runner RUNNER&quot;, &quot;Use a custom Runner.&quot;],         :drb =&gt; [&quot;-X&quot;, &quot;--drb&quot;, &quot;Run examples via DRb. (For example against script/spec_server)&quot;],         :version =&gt; [&quot;-v&quot;, &quot;--version&quot;, &quot;Show version&quot;],         :help =&gt; [&quot;-h&quot;, &quot;--help&quot;, &quot;You're looking at it&quot;]</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">options</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000599" class="method-detail">
        <a name="M000599"></a>

        <div class="method-heading">
          <a href="#M000599" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(err, out)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000599-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000599-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 87</span>
 87:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">err</span>, <span class="ruby-identifier">out</span>)
 88:         <span class="ruby-keyword kw">super</span>()
 89:         <span class="ruby-ivar">@error_stream</span> = <span class="ruby-identifier">err</span>
 90:         <span class="ruby-ivar">@out_stream</span> = <span class="ruby-identifier">out</span>
 91:         <span class="ruby-ivar">@options</span> = <span class="ruby-constant">Options</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@error_stream</span>, <span class="ruby-ivar">@out_stream</span>)
 92: 
 93:         <span class="ruby-ivar">@file_factory</span> = <span class="ruby-constant">File</span>
 94: 
 95:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">&quot;Usage: spec (FILE|DIRECTORY|GLOB)+ [options]&quot;</span>
 96:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
 97:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:pattern</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">pattern</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">filename_pattern</span> = <span class="ruby-identifier">pattern</span>}
 98:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:diff</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">diff</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">parse_diff</span>(<span class="ruby-identifier">diff</span>)}
 99:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:colour</span>]) {<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">colour</span> = <span class="ruby-keyword kw">true</span>}
100:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:example</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">example</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">parse_example</span>(<span class="ruby-identifier">example</span>)}
101:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:specification</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">example</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">parse_example</span>(<span class="ruby-identifier">example</span>)}
102:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:line</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">line_number</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">line_number</span> = <span class="ruby-identifier">line_number</span>.<span class="ruby-identifier">to_i</span>}
103:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:format</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">parse_format</span>(<span class="ruby-identifier">format</span>)}
104:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:require</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">requires</span><span class="ruby-operator">|</span> <span class="ruby-identifier">invoke_requires</span>(<span class="ruby-identifier">requires</span>)}
105:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:backtrace</span>]) {<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">backtrace_tweaker</span> = <span class="ruby-constant">NoisyBacktraceTweaker</span>.<span class="ruby-identifier">new</span>}
106:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:loadby</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">loadby</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">loadby</span> = <span class="ruby-identifier">loadby</span>}
107:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:reverse</span>]) {<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">reverse</span> = <span class="ruby-keyword kw">true</span>}
108:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:timeout</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">timeout</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">timeout</span> = <span class="ruby-identifier">timeout</span>.<span class="ruby-identifier">to_f</span>}
109:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:heckle</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">heckle</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">load_heckle_runner</span>(<span class="ruby-identifier">heckle</span>)}
110:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:dry_run</span>]) {<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">dry_run</span> = <span class="ruby-keyword kw">true</span>}
111:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:options_file</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">options_file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">parse_options_file</span>(<span class="ruby-identifier">options_file</span>)}
112:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:generate_options</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">options_file</span><span class="ruby-operator">|</span>}
113:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:runner</span>]) {<span class="ruby-operator">|</span><span class="ruby-identifier">runner</span><span class="ruby-operator">|</span>  <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">user_input_for_runner</span> = <span class="ruby-identifier">runner</span>}
114:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:drb</span>]) {}
115:         <span class="ruby-identifier">on</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:version</span>]) {<span class="ruby-identifier">parse_version</span>}
116:         <span class="ruby-identifier">on_tail</span>(<span class="ruby-operator">*</span><span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:help</span>]) {<span class="ruby-identifier">parse_help</span>}
117:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000598" class="method-detail">
        <a name="M000598"></a>

        <div class="method-heading">
          <a href="#M000598" class="method-signature">
          <span class="method-name">parse</span><span class="method-args">(args, err, out)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000598-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000598-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 8</span>
 8:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">err</span>, <span class="ruby-identifier">out</span>)
 9:           <span class="ruby-identifier">parser</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">err</span>, <span class="ruby-identifier">out</span>)
10:           <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">args</span>)
11:           <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">options</span>
12:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000600" class="method-detail">
        <a name="M000600"></a>

        <div class="method-heading">
          <a href="#M000600" class="method-signature">
          <span class="method-name">order!</span><span class="method-args">(argv, &amp;blk)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000600-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000600-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 119</span>
119:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">order!</span>(<span class="ruby-identifier">argv</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
120:         <span class="ruby-ivar">@argv</span> = <span class="ruby-identifier">argv</span>
121:         <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">argv</span> = <span class="ruby-ivar">@argv</span>.<span class="ruby-identifier">dup</span>
122:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parse_generate_options</span>
123:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parse_drb</span>
124:         
125:         <span class="ruby-keyword kw">super</span>(<span class="ruby-ivar">@argv</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
126:           <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">files</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
127:           <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">blk</span>
128:         <span class="ruby-keyword kw">end</span>
129: 
130:         <span class="ruby-ivar">@options</span>
131:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000601" class="method-detail">
        <a name="M000601"></a>

        <div class="method-heading">
          <a href="#M000601" class="method-signature">
          <span class="method-name">invoke_requires</span><span class="method-args">(requires)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000601-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000601-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 134</span>
134:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke_requires</span>(<span class="ruby-identifier">requires</span>)
135:         <span class="ruby-identifier">requires</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;,&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
136:           <span class="ruby-identifier">require</span> <span class="ruby-identifier">file</span>
137:         <span class="ruby-keyword kw">end</span>
138:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000605" class="method-detail">
        <a name="M000605"></a>

        <div class="method-heading">
          <a href="#M000605" class="method-signature">
          <span class="method-name">parse_drb</span><span class="method-args">(argv = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000605-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000605-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 176</span>
176:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_drb</span>(<span class="ruby-identifier">argv</span> = <span class="ruby-keyword kw">nil</span>)
177:         <span class="ruby-identifier">argv</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">argv</span> <span class="ruby-comment cmt"># TODO - see note about about http://rspec.lighthouseapp.com/projects/5645/tickets/293</span>
178:         <span class="ruby-identifier">is_drb</span> = <span class="ruby-keyword kw">false</span>
179:         <span class="ruby-identifier">is_drb</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:drb</span>][<span class="ruby-value">0</span>])
180:         <span class="ruby-identifier">is_drb</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">OPTIONS</span>[<span class="ruby-identifier">:drb</span>][<span class="ruby-value">1</span>])
181:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">is_drb</span>
182:         <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">examples_should_not_be_run</span>
183:         <span class="ruby-constant">DrbCommandLine</span>.<span class="ruby-identifier">run</span>(
184:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">argv</span>, <span class="ruby-ivar">@error_stream</span>, <span class="ruby-ivar">@out_stream</span>)
185:         )
186:         <span class="ruby-keyword kw">true</span>
187:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000603" class="method-detail">
        <a name="M000603"></a>

        <div class="method-heading">
          <a href="#M000603" class="method-signature">
          <span class="method-name">parse_generate_options</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000603-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000603-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 149</span>
149:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_generate_options</span>
150:         <span class="ruby-comment cmt"># Remove the --generate-options option and the argument before writing to file</span>
151:         <span class="ruby-identifier">options_file</span> = <span class="ruby-keyword kw">nil</span>
152:         [<span class="ruby-value str">'-G'</span>, <span class="ruby-value str">'--generate-options'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">option</span><span class="ruby-operator">|</span>
153:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">index</span> = <span class="ruby-ivar">@argv</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">option</span>)
154:             <span class="ruby-ivar">@argv</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">index</span>)
155:             <span class="ruby-identifier">options_file</span> = <span class="ruby-ivar">@argv</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">index</span>)
156:           <span class="ruby-keyword kw">end</span>
157:         <span class="ruby-keyword kw">end</span>
158:         
159:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options_file</span>
160:           <span class="ruby-identifier">write_generated_options</span>(<span class="ruby-identifier">options_file</span>)
161:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
162:         <span class="ruby-keyword kw">else</span>
163:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
164:         <span class="ruby-keyword kw">end</span>
165:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000607" class="method-detail">
        <a name="M000607"></a>

        <div class="method-heading">
          <a href="#M000607" class="method-signature">
          <span class="method-name">parse_help</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000607-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000607-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 194</span>
194:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_help</span>
195:         <span class="ruby-ivar">@out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">self</span>
196:         <span class="ruby-identifier">exit</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stdout?</span>
197:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000602" class="method-detail">
        <a name="M000602"></a>

        <div class="method-heading">
          <a href="#M000602" class="method-signature">
          <span class="method-name">parse_options_file</span><span class="method-args">(options_file)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000602-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000602-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 140</span>
140:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_options_file</span>(<span class="ruby-identifier">options_file</span>)
141:         <span class="ruby-identifier">option_file_args</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">options_file</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">split</span> <span class="ruby-value str">&quot; &quot;</span>}.<span class="ruby-identifier">flatten</span>
142:         <span class="ruby-ivar">@argv</span>.<span class="ruby-identifier">push</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">option_file_args</span>)
143:         <span class="ruby-comment cmt"># TODO - this is a brute force solution to http://rspec.lighthouseapp.com/projects/5645/tickets/293.</span>
144:         <span class="ruby-comment cmt"># Let's look for a cleaner way. Might not be one. But let's look. If not, perhaps</span>
145:         <span class="ruby-comment cmt"># this can be moved to a different method to indicate the special handling for drb?</span>
146:         <span class="ruby-identifier">parse_drb</span>(<span class="ruby-ivar">@argv</span>)
147:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000606" class="method-detail">
        <a name="M000606"></a>

        <div class="method-heading">
          <a href="#M000606" class="method-signature">
          <span class="method-name">parse_version</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000606-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000606-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 189</span>
189:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_version</span>
190:         <span class="ruby-ivar">@out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-operator">::</span><span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span><span class="ruby-operator">::</span><span class="ruby-constant">SUMMARY</span>
191:         <span class="ruby-identifier">exit</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stdout?</span>
192:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000608" class="method-detail">
        <a name="M000608"></a>

        <div class="method-heading">
          <a href="#M000608" class="method-signature">
          <span class="method-name">stdout?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000608-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000608-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 199</span>
199:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdout?</span>
200:         <span class="ruby-ivar">@out_stream</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">$stdout</span>
201:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000604" class="method-detail">
        <a name="M000604"></a>

        <div class="method-heading">
          <a href="#M000604" class="method-signature">
          <span class="method-name">write_generated_options</span><span class="method-args">(options_file)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000604-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000604-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/option_parser.rb, line 167</span>
167:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_generated_options</span>(<span class="ruby-identifier">options_file</span>)
168:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">options_file</span>, <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
169:           <span class="ruby-identifier">io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-ivar">@argv</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
170:         <span class="ruby-keyword kw">end</span>
171:         <span class="ruby-ivar">@out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nOptions written to #{options_file}. You can now use these options with:&quot;</span>
172:         <span class="ruby-ivar">@out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;spec --options #{options_file}&quot;</span>
173:         <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">examples_should_not_be_run</span>
174:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>